package com.neu.service;

import com.neu.dao.RoomTypeDao;
import com.neu.pojo.RoomType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RoomTypeServiceImpl  implements RoomTypeService{
    @Autowired
    private RoomTypeDao roomTypeDao;
    @Override
    public int addRoomType(RoomType roomType) {
        return roomTypeDao.addRoomType(roomType);
    }

    @Override
    public int delRoomType(String roomType) {
        return roomTypeDao.delRoomType(roomType);
    }

    @Override
    public List<RoomType> getRoomTypeByPage(int page, int limit) {

        return roomTypeDao.getRoomTypeByPage((page-1)*limit,limit);
    }

    @Override
    public int getRoomTypeCount() {
        return roomTypeDao.getRoomTypeCount();
    }

    @Override
    public int updateRoomType(RoomType roomType) {
        return roomTypeDao.updateRoomType(roomType);
    }
}
